<!DOCTYPE html>
<html lang="zh-cn">
<head prefix="og: http://ogp.me/ns#">
  <meta charset="utf-8">
  <title>starRTC文档</title>
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Canonical links -->
  <link rel="canonical" href="https://starrtc.gitee.io/zh-cn/docs/web-2.html">
  <!-- Alternative links -->
  
    
      <link rel="alternative" hreflang="en" href="https://starrtc.gitee.io/docs/web-2.html">
    
      <link rel="alternative" hreflang="zh-cn" href="https://starrtc.gitee.io/zh-cn/docs/web-2.html">
    
  
  <!-- Icon -->
  <link rel="apple-touch-icon" sizes="57x57" href="/icon/apple-touch-icon-57x57.png">
  <link rel="apple-touch-icon" sizes="114x114" href="/icon/apple-touch-icon-114x114.png">
  <link rel="apple-touch-icon" sizes="72x72" href="/icon/apple-touch-icon-72x72.png">
  <link rel="apple-touch-icon" sizes="144x144" href="/icon/apple-touch-icon-144x144.png">
  <link rel="apple-touch-icon" sizes="60x60" href="/icon/apple-touch-icon-60x60.png">
  <link rel="apple-touch-icon" sizes="120x120" href="/icon/apple-touch-icon-120x120.png">
  <link rel="apple-touch-icon" sizes="76x76" href="/icon/apple-touch-icon-76x76.png">
  <link rel="apple-touch-icon" sizes="152x152" href="/icon/apple-touch-icon-152x152.png">
  <link rel="icon" type="image/png" href="/icon/favicon-196x196.png" sizes="196x196">
  <link rel="icon" type="image/png" href="/icon/favicon-160x160.png" sizes="160x160">
  <link rel="icon" type="image/png" href="/icon/favicon-96x96.png" sizes="96x96">
  <link rel="icon" type="image/png" href="/icon/favicon-16x16.png" sizes="16x16">
  <link rel="icon" type="image/png" href="/icon/favicon-32x32.png" sizes="32x32">
  <meta name="msapplication-TileColor" content="#2f83cd">
  <meta name="msapplication-TileImage" content="/icon/mstile-144x144.png">
  <!-- CSS -->
  <!-- build:css build/css/navy.css -->
  <link rel="stylesheet" href="/css/navy.css">
  <!-- endbuild -->
  <link href="https://starrtc.gitee.io/googleapis.css" rel="stylesheet" type="text/css">
 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> 
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css">
  <!-- RSS -->
  <link rel="alternate" href="/atom.xml" title="starRTC文档">
  <!-- Open Graph -->
  <meta name="description" content="SDK的说明和api介绍1. SDK对象简介 table th:nth-of-type(2) {     width: 200px; }      类 介绍 功能     LOG_LEVEL 日志等级 日志等级枚举   CHATROOM_LIST_TYPE 列表类型 列表类型枚举   StarRtc.StarConfig 配置对象 保存配置信息   StarRtc.StarUserInfo 用户信">
<meta property="og:type" content="website">
<meta property="og:title" content="starRTC文档">
<meta property="og:url" content="https://starrtc.gitee.io/zh-cn/docs/web-2.html">
<meta property="og:site_name" content="starRTC文档">
<meta property="og:description" content="SDK的说明和api介绍1. SDK对象简介 table th:nth-of-type(2) {     width: 200px; }      类 介绍 功能     LOG_LEVEL 日志等级 日志等级枚举   CHATROOM_LIST_TYPE 列表类型 列表类型枚举   StarRtc.StarConfig 配置对象 保存配置信息   StarRtc.StarUserInfo 用户信">
<meta property="og:locale" content="zh-cn">
<meta property="og:updated_time" content="2020-09-06T00:27:31.380Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="starRTC文档">
<meta name="twitter:description" content="SDK的说明和api介绍1. SDK对象简介 table th:nth-of-type(2) {     width: 200px; }      类 介绍 功能     LOG_LEVEL 日志等级 日志等级枚举   CHATROOM_LIST_TYPE 列表类型 列表类型枚举   StarRtc.StarConfig 配置对象 保存配置信息   StarRtc.StarUserInfo 用户信">
<meta name="twitter:site" content="hexojs">
<meta property="fb:admins" content="100000247608790">
  <!-- Google Analytics -->
  
</head>

<body>
  <div id="container">
    <header id="header" class="wrapper">
  <div id="header-inner" class="inner">
    <h1 id="logo-wrap">
      
      <a href="https://starrtc.gitee.io/" id="logo">starRTC</a>
    </h1>
    <nav id="main-nav">
      <a href="https://starrtc.gitee.io/" class="main-nav-link">官网</a><a href="https://blog.starRTC.com" class="main-nav-link">博客</a><a href="https://github.com/starrtc/android-demo/issues" class="main-nav-link">论坛</a><a href="/zh-cn/docs/" class="main-nav-link">文档</a><a href="/zh-cn/download/" class="main-nav-link">下载</a><a href="/zh-cn/contact/" class="main-nav-link">联系我们</a>
      
    </nav>
    <div id="lang-select-wrap">
      <label id="lang-select-label"><i class="fa fa-globe"></i><span>简体中文</span></label>
      <select id="lang-select" data-canonical="docs/web-2.html">
        
          <option value="en">English</option>
        
          <option value="zh-cn" selected>简体中文</option>
        
      </select>
    </div>
    <a id="mobile-nav-toggle">
      <span class="mobile-nav-toggle-bar"></span>
      <span class="mobile-nav-toggle-bar"></span>
      <span class="mobile-nav-toggle-bar"></span>
    </a>
  </div>
</header>

    <div id="content-wrap">
  <div id="content" class="wrapper">
    <div id="content-inner">
      <article class="article-container" itemscope itemtype="http://schema.org/Article">
        <div class="article-inner">
          <div class="article">
            <div class="inner">
              <header class="article-header">
                <h1 class="article-title" itemprop="name"></h1>
                <a href="https://github.com/starRTC/docs/edit/master/zh-cn/docs/web-2.md" class="article-edit-link" title="改进本文"><i class="fa fa-pencil"></i></a>
              </header>
              <div class="article-content" itemprop="articleBody">
                <h1 id="SDK的说明和api介绍" class="article-heading"><a href="#SDK的说明和api介绍" class="headerlink" title="SDK的说明和api介绍"></a>SDK的说明和api介绍<a class="article-anchor" href="#SDK的说明和api介绍" aria-hidden="true"></a></h1><h2 id="1-SDK对象简介" class="article-heading"><a href="#1-SDK对象简介" class="headerlink" title="1. SDK对象简介"></a>1. SDK对象简介<a class="article-anchor" href="#1-SDK对象简介" aria-hidden="true"></a></h2><style>
table th:nth-of-type(2) {
    width: 200px;
}
</style>

<table>
<thead>
<tr>
<th style="text-align:left">类</th>
<th style="text-align:left">介绍</th>
<th style="text-align:left">功能</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">LOG_LEVEL</td>
<td style="text-align:left">日志等级</td>
<td style="text-align:left">日志等级枚举</td>
</tr>
<tr>
<td style="text-align:left">CHATROOM_LIST_TYPE</td>
<td style="text-align:left">列表类型</td>
<td style="text-align:left">列表类型枚举</td>
</tr>
<tr>
<td style="text-align:left">StarRtc.StarConfig</td>
<td style="text-align:left">配置对象</td>
<td style="text-align:left">保存配置信息</td>
</tr>
<tr>
<td style="text-align:left">StarRtc.StarUserInfo</td>
<td style="text-align:left">用户信息对象</td>
<td style="text-align:left">保存用户信息</td>
</tr>
<tr>
<td style="text-align:left">StarRtc.StarSDK</td>
<td style="text-align:left">SDK实例类</td>
<td style="text-align:left">提供登录，收发IM消息，群组管理，收发群组消息， SDK的高级业务封装接口，允许多实例</td>
</tr>
<tr>
<td style="text-align:left">StarRtc.StarRoomSDK</td>
<td style="text-align:left">房间SDK</td>
<td style="text-align:left">整合videoSDK和chatSDK，提供完整的room功能（voip，meeting，live）</td>
</tr>
<tr>
<td style="text-align:left">StarRtc.StarSuperRoomSDK</td>
<td style="text-align:left">超级对讲房间SDK</td>
<td style="text-align:left">超级对讲房间SDK，半双工，自由上麦说话</td>
</tr>
<tr>
<td style="text-align:left">StarRtc.StarChatRoomSDK</td>
<td style="text-align:left">聊天室房间SDK</td>
<td style="text-align:left">聊天室SDK的简单业务封装</td>
</tr>
<tr>
<td style="text-align:left">StarRtc.StarVideoRoomSDK</td>
<td style="text-align:left">视频房间SDK</td>
<td style="text-align:left">视频SDK的简单业务封装</td>
</tr>
<tr>
<td style="text-align:left">StarRtc.StarVideoSDK</td>
<td style="text-align:left">视频SDK</td>
<td style="text-align:left">负责音视频功能</td>
</tr>
<tr>
<td style="text-align:left">StarRtc.StarChatSDK</td>
<td style="text-align:left">聊天室SDK</td>
<td style="text-align:left">负责聊天室功能</td>
</tr>
</tbody>
</table>
<hr>
<h2 id="2-LOG-LEVEL" class="article-heading"><a href="#2-LOG-LEVEL" class="headerlink" title="2. LOG_LEVEL"></a>2. LOG_LEVEL<a class="article-anchor" href="#2-LOG-LEVEL" aria-hidden="true"></a></h2><figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="keyword">var</span> LOG_LEVEL = &#123;</span><br><span class="line">	LOG_LEVEL_DEBUG: i++,</span><br><span class="line">	LOG_LEVEL_INFO: i++,</span><br><span class="line">	LOG_LEVEL_WARN: i++,</span><br><span class="line">	LOG_LEVEL_ERROR: i++</span><br><span class="line">	&#125;;</span><br><span class="line"></span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 设置日志等级，开启低等级日志会包含高等级日志，如开启DEBUG，则同时开启INFO、WARN、ERROR，默认为开启DEBUG</span></span><br><span class="line"><span class="comment"> * @param logLevel	日志等级，见LOG_LEVEL</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line">StarRtc.InitlogLevel = <span class="function"><span class="keyword">function</span> (<span class="params">logLevel</span>)</span></span><br></pre></td></tr></table></figure>
<hr>
<h2 id="3-CHATROOM-LIST-TYPE" class="article-heading"><a href="#3-CHATROOM-LIST-TYPE" class="headerlink" title="3. CHATROOM_LIST_TYPE"></a>3. CHATROOM_LIST_TYPE<a class="article-anchor" href="#3-CHATROOM-LIST-TYPE" aria-hidden="true"></a></h2><figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="keyword">var</span> CHATROOM_LIST_TYPE = &#123;</span><br><span class="line">	<span class="comment">//列表类型：聊天室</span></span><br><span class="line">	CHATROOM_LIST_TYPE_CHATROOM: i++,</span><br><span class="line">	<span class="comment">//列表类型：直播</span></span><br><span class="line">	CHATROOM_LIST_TYPE_LIVE: i++,</span><br><span class="line">	<span class="comment">//列表类型：直播推流</span></span><br><span class="line">	CHATROOM_LIST_TYPE_LIVE_PUSH: i++,</span><br><span class="line">	<span class="comment">//列表类型：会议</span></span><br><span class="line">	CHATROOM_LIST_TYPE_MEETING: i++,</span><br><span class="line">	<span class="comment">//列表类型：会议推流</span></span><br><span class="line">	CHATROOM_LIST_TYPE_MEETING_PUSH: i++,</span><br><span class="line">	<span class="comment">//列表类型：小班课</span></span><br><span class="line">	CHATROOM_LIST_TYPE_CLASS: i++,</span><br><span class="line">	<span class="comment">//列表类型：小班课推流</span></span><br><span class="line">	CHATROOM_LIST_TYPE_CLASS_PUSH: i++,</span><br><span class="line">	<span class="comment">//列表类型：音频直播</span></span><br><span class="line">	CHATROOM_LIST_TYPE_AUDIO_LIVE: i++,</span><br><span class="line">	<span class="comment">//列表类型：音频直播推流</span></span><br><span class="line">	CHATROOM_LIST_TYPE_AUDIO_LIVE_PUSH: i++,</span><br><span class="line">	<span class="comment">//列表类型：超级对讲</span></span><br><span class="line">	CHATROOM_LIST_TYPE_SUPER_ROOM: i++,</span><br><span class="line">	<span class="comment">//列表类型：超级对讲推流</span></span><br><span class="line">	CHATROOM_LIST_TYPE_SUPER_ROOM_PUSH: i++</span><br><span class="line">&#125;;</span><br></pre></td></tr></table></figure>
<hr>
<h2 id="4-StarRtc-StarConfig" class="article-heading"><a href="#4-StarRtc-StarConfig" class="headerlink" title="4. StarRtc.StarConfig"></a>4. StarRtc.StarConfig<a class="article-anchor" href="#4-StarRtc-StarConfig" aria-hidden="true"></a></h2><figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="comment">//是否开启使用AEC</span></span><br><span class="line">StarRtc.StarConfig.configUseAEC;</span><br><span class="line"></span><br><span class="line"><span class="comment">//msgServer地址</span></span><br><span class="line">StarRtc.StarConfig.msgServerUrl;</span><br><span class="line"><span class="comment">//msgServer websocket端口</span></span><br><span class="line">StarRtc.StarConfig.msgServerWebsocketPort;</span><br><span class="line"><span class="comment">//chatRoomServer地址</span></span><br><span class="line">StarRtc.StarConfig.chatRoomServerUrl;</span><br><span class="line"><span class="comment">//chatRoomServer websocket端口</span></span><br><span class="line">StarRtc.StarConfig.chatRoomServerWebsocketPort;</span><br><span class="line"><span class="comment">//srcServer地址</span></span><br><span class="line">StarRtc.StarConfig.srcServerUrl;</span><br><span class="line"><span class="comment">//srcServer websocket端口</span></span><br><span class="line">StarRtc.StarConfig.srcServerWebsocketPort;</span><br><span class="line"><span class="comment">//srcServer webrtc端口</span></span><br><span class="line">StarRtc.StarConfig.srcServerWebrtcPort;</span><br><span class="line"><span class="comment">//vdnServer地址</span></span><br><span class="line">StarRtc.StarConfig.vdnServerUrl;</span><br><span class="line"><span class="comment">//vdnServer websocket端口</span></span><br><span class="line">StarRtc.StarConfig.vdnServerWebsocketPort;</span><br><span class="line"><span class="comment">//vdnServer webrtc端口</span></span><br><span class="line">StarRtc.StarConfig.vdnServerWebrtcPort;</span><br><span class="line"><span class="comment">//voipServer地址</span></span><br><span class="line">StarRtc.StarConfig.voipServerUrl;</span><br><span class="line"><span class="comment">//voipServer 端口</span></span><br><span class="line">StarRtc.StarConfig.voipServerPort;</span><br><span class="line"><span class="comment">//voipServer websocket端口</span></span><br><span class="line">StarRtc.StarConfig.voipServerWebsocketPort;</span><br><span class="line"><span class="comment">//voipServer webrtc端口</span></span><br><span class="line">StarRtc.StarConfig.voipServerWebrtcPort;</span><br></pre></td></tr></table></figure>
<hr>
<h2 id="5-StarRtc-StarUserInfo" class="article-heading"><a href="#5-StarRtc-StarUserInfo" class="headerlink" title="5. StarRtc.StarUserInfo"></a>5. StarRtc.StarUserInfo<a class="article-anchor" href="#5-StarRtc-StarUserInfo" aria-hidden="true"></a></h2><figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="comment">//应用id</span></span><br><span class="line">StarRtc.StarUserInfo.agentId = <span class="string">""</span>;</span><br><span class="line"><span class="comment">//用户id</span></span><br><span class="line">StarRtc.StarUserInfo.userId = <span class="string">""</span>;</span><br><span class="line"><span class="comment">//应用id_用户id</span></span><br><span class="line">StarRtc.StarUserInfo.starUid = <span class="string">""</span>;</span><br><span class="line"><span class="comment">//token</span></span><br><span class="line">StarRtc.StarUserInfo.starToken = <span class="string">""</span>;</span><br></pre></td></tr></table></figure>
<hr>
<h2 id="6-StarRtc-StarSDK" class="article-heading"><a href="#6-StarRtc-StarSDK" class="headerlink" title="6. StarRtc.StarSDK"></a>6. StarRtc.StarSDK<a class="article-anchor" href="#6-StarRtc-StarSDK" aria-hidden="true"></a></h2><figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 构造函数</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line">StarRtc.StarSDK = <span class="function"><span class="keyword">function</span> (<span class="params"></span>)</span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 获取<span class="title">SDK</span>版本号</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">version</span> = <span class="title">function</span> (<span class="params"></span>)</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 设置<span class="title">msgServer</span>地址和端口</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">msgServerUrl</span> 					<span class="title">msgServer</span>地址</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">msgServerWebsocketPort</span> 		<span class="title">msgServer</span> <span class="title">websocket</span> 端口</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">setMsgServerInfo</span> = <span class="title">function</span> (<span class="params">msgServerUrl, msgServerWebsocketPort</span>)</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 设置<span class="title">chatRoomServer</span>地址和端口</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">chatRoomServerUrl</span> 			<span class="title">chatRoomServer</span>地址</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">chatRoomServerWebsocketPort</span> 	<span class="title">chatRoomServer</span> <span class="title">websocket</span> 端口</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">setChatRoomServerInfo</span> = <span class="title">function</span> (<span class="params">chatRoomServerUrl, chatRoomServerWebsocketPort</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 设置<span class="title">srcServer</span>地址和端口</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">srcServerUrl</span> 					<span class="title">srcServer</span>地址</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">srcServerWebsocketPort</span> 		<span class="title">srcServer</span> <span class="title">websocket</span> 端口</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">srcServerWebrtcPort</span> 			<span class="title">srcServer</span> <span class="title">webrtc</span> 端口</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">srcServerWebrtcIP</span> 			<span class="title">srcServer</span> <span class="title">webrtc</span> <span class="title">IP</span>(<span class="params">chrome72版本以下、firefox、safari使用</span>)，可选，不填写时与<span class="title">Server</span>地址相同</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">setSrcServerInfo</span> = <span class="title">function</span> (<span class="params">srcServerUrl, srcServerWebsocketPort, srcServerWebrtcPort, srcServerWebrtcIP</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 设置<span class="title">vdnServer</span>地址和端口</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">vdnServerUrl</span> 					<span class="title">vdnServer</span>地址</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">vdnServerWebsocketPort</span> 		<span class="title">vdnServer</span> <span class="title">websocket</span> 端口</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">vdnServerWebrtcPort</span> 			<span class="title">vdnServer</span> <span class="title">webrtc</span> 端口</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">vdnServerWebrtcIP</span> 			<span class="title">vdnServer</span> <span class="title">webrtc</span> <span class="title">IP</span>(<span class="params">chrome72版本以下、firefox、safari使用</span>)，可选，不填写时与<span class="title">Server</span>地址相同</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">setVdnServerInfo</span> = <span class="title">function</span> (<span class="params">vdnServerUrl, vdnServerWebsocketPort, vdnServerWebrtcPort, vdnServerWebrtcIP</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 设置<span class="title">voipServer</span>地址和端口</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">voipServerUrl</span> 				<span class="title">voipServer</span>地址</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">voipServerPort</span> 				<span class="title">voipServer</span>端口</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">voipServerWebsocketPort</span> 		<span class="title">voipServer</span> <span class="title">websocket</span> 端口</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">voipServerWebrtcPort</span> 			<span class="title">voipServer</span> <span class="title">webrtc</span> 端口</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">voipServerWebrtcIP</span> 			<span class="title">voipServer</span> <span class="title">webrtc</span> <span class="title">IP</span>(<span class="params">chrome72版本以下、firefox、safari使用</span>)，可选，不填写时与<span class="title">Server</span>地址相同</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">setVoipServerInfo</span> = <span class="title">function</span> (<span class="params">voipServerUrl, voipServerPort, voipServerWebsocketPort, voipServerWebrtcPort, voipServerWebrtcIP</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 设置是否启用<span class="title">AEC</span></span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">flag</span> 							启用标志位</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">setConfigUseAEC</span> = <span class="title">function</span> (<span class="params">flag</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 登录</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_agentId</span> 						应用<span class="title">id</span>（私有部署时无意义，可为""）</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_userId</span> 						用户<span class="title">id</span></span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_callback</span> 					处理登录的回调函数</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">login</span> = <span class="title">function</span> (<span class="params">_agentId, _userId, _callback</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 登出</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">logout</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 发送单聊消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_targetId</span> 					目标<span class="title">userId</span></span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_digest</span> 						<span class="title">digest</span></span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_txt</span> 							正文</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_type</span> 						消息类型（可选参数）</span></span><br><span class="line"><span class="function"> */	</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">sendSingleMsg</span> = <span class="title">function</span> (<span class="params">_targetId, _digest, _txt, _type</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 发送群组消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_targetGroupId</span> 				群组<span class="title">id</span></span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_digest</span> 						<span class="title">digest</span></span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_txt</span> 							正文</span></span><br><span class="line"><span class="function"> */	</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">sendGroupMsg</span> = <span class="title">function</span> (<span class="params">_targetGroupId, _digest, _txt</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 发送<span class="title">voip</span>控制消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_targetId</span>	对方用户<span class="title">Id</span></span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_code</span>		控制码</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">sendVoipCtrlMsg</span> = <span class="title">function</span> (<span class="params">_targetId, _code</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 发送<span class="title">voip</span>呼叫消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_targetId</span>						对方用户<span class="title">Id</span></span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_ts</span>							时间戳（可选）</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_flag</span>							是否是音频呼叫，默认为<span class="title">false</span>（可选）</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">sendVoipCallMsg</span> = <span class="title">function</span> (<span class="params">_targetId, _ts, _flag</span>)</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 发送<span class="title">voip</span>拒绝消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_targetId</span>						对方用户<span class="title">Id</span></span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">sendVoipRefuseMsg</span> = <span class="title">function</span> (<span class="params">_targetId</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 发送<span class="title">voip</span>挂断消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_targetId</span>						对方用户<span class="title">Id</span></span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">sendVoipHungupMsg</span> = <span class="title">function</span> (<span class="params">_targetId</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 发送<span class="title">voip</span>忙碌消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_targetId</span>						对方用户<span class="title">Id</span></span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">sendVoipBusyMsg</span> = <span class="title">function</span> (<span class="params">_targetId</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 发送<span class="title">voip</span>同意连接消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_targetId</span>						对方用户<span class="title">Id</span></span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">sendVoipConnectMsg</span> = <span class="title">function</span> (<span class="params">_targetId</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 设置回调，用于接管<span class="title">login</span>方法中设置的登录回调中的<span class="title">onVoipMessage</span>部分</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_callback</span>						回调函数</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSDK</span>.<span class="title">setIMExtraback</span> = <span class="title">function</span> (<span class="params">_callback</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 创建视频会议房间</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_oper</span>							操作类型：<span class="title">new</span>，创建；<span class="title">open</span>，加入</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_userCallback</span>					消息回调</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">_userData</span>						存储视频会议房间的相关信息（<span class="title">id</span>，<span class="title">name</span>，<span class="title">creator</span>），结构为</span>&#123;<span class="string">"roomInfo"</span>:&#123;<span class="string">"id"</span>:<span class="string">""</span>, <span class="string">"name"</span>:<span class="string">""</span>, <span class="string">"creator"</span>:<span class="string">""</span>&#125;&#125;</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.getVideoMeetingRoomSDK = function (_oper, _userCallback, _userData) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 创建直播房间</span><br><span class="line"> * @param _type							类型：vdn，观看者；src，上传者</span><br><span class="line"> * @param _oper							操作类型：<span class="keyword">new</span>，创建；open，加入</span><br><span class="line"> * @param _userCallback					消息回调</span><br><span class="line"> * @param _userData						存储直播房间的相关信息（id，name，creator），结构为&#123;<span class="string">"roomInfo"</span>:&#123;<span class="string">"id"</span>:<span class="string">""</span>, <span class="string">"name"</span>:<span class="string">""</span>, <span class="string">"creator"</span>:<span class="string">""</span>&#125;&#125;</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.getVideoLiveRoomSDK = function (_type, _oper, _userCallback, _userData) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 创建voip房间</span><br><span class="line"> * @param _oper							操作类型：call，呼叫者；response，应答者</span><br><span class="line"> * @param _userCallback					消息回调</span><br><span class="line"> * @param _userData						存储voip房间对方id信息，结构为&#123;<span class="string">"roomInfo"</span>:&#123;<span class="string">"targetId"</span>:对方id, <span class="string">"audioOnly"</span>:是否仅进行音频聊天（可不传入，默认值为<span class="literal">false</span>，视频聊天）&#125;&#125;</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.getVoipRoomSDK = function (_oper, _userCallback, _userData) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 创建聊天室房间</span><br><span class="line"> * @param _oper							操作类型：<span class="keyword">new</span>，创建；open，加入</span><br><span class="line"> * @param _userCallback					消息回调</span><br><span class="line"> * @param _userData						存储直播房间的相关信息（id，name，creator），结构为&#123;<span class="string">"roomInfo"</span>:&#123;<span class="string">"id"</span>:<span class="string">""</span>, <span class="string">"name"</span>:<span class="string">""</span>, <span class="string">"creator"</span>:<span class="string">""</span>&#125;&#125;</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.getChatRoomSDK = function (_oper, _userCallback, _userData) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 创建视频房间（仅支持视频功能，无聊天室）</span><br><span class="line"> * @param _type						类型：vdn，观看者；src，上传者</span><br><span class="line"> * @param _oper						操作类型：<span class="keyword">new</span>，创建；open，加入</span><br><span class="line"> * @param _userCallback				消息回调</span><br><span class="line"> * @param _userData					存储聊天室的相关信息（id，name，creator），结构为&#123;<span class="string">"roomInfo"</span>:&#123;<span class="string">"id"</span>:<span class="string">""</span>, <span class="string">"name"</span>:<span class="string">""</span>, <span class="string">"creator"</span>:<span class="string">""</span>&#125;&#125;</span><br><span class="line"> * @param _liveType					房间类型，见CHATROOM_LIST_TYPE</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.getVideoRoomSDK = function (_type, _oper, _userCallback, _userData, _liveType) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 查询列表（非AEC下使用此接口做演示）</span><br><span class="line"> * @param listTypes						数组，值见CHATROOM_LIST_TYPE</span><br><span class="line"> * @param callback						回调函数</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.queryRoom = function (listTypes, callback) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 设置群免打扰</span><br><span class="line"> * @param ignore 						<span class="literal">true</span>：设置免打扰；<span class="literal">false</span>：取消免打扰</span><br><span class="line"> *<span class="regexp">/	</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.setGroupMsgPush = function (ignore) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 移除指定群用户</span><br><span class="line"> * @param groupId 						群组id</span><br><span class="line"> * @param removeUsers 					待移除的用户，类型为数组</span><br><span class="line"> *<span class="regexp">/	</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.removeGroupUsers = function (groupId, removeUsers) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 添加指定群用户</span><br><span class="line"> * @param groupId 						群组id</span><br><span class="line"> * @param addUsers 						待添加的用户，类型为数组</span><br><span class="line"> * @param userDefineData 	</span><br><span class="line"> *<span class="regexp">/	</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.addGroupUsers = function (groupId, addUsers, userDefineData) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 删除指定群组</span><br><span class="line"> * @param groupId 						群组id</span><br><span class="line"> *<span class="regexp">/	</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.delGroup = function (groupId) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 创建群组</span><br><span class="line"> * @param addUsers 						待添加的用户，类型为数组</span><br><span class="line"> * @param userDefineData 	</span><br><span class="line"> *<span class="regexp">/	</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.createGroup = function (addUsers, userDefineData) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 请求群组列表</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.getGroupList = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 请求指定群用户列表</span><br><span class="line"> * @param groupId						群组id</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.getGroupUserList = function (groupId) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 请求当前在线人数</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.getOnlineNumber = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 请求全部用户列表</span><br><span class="line"> * @param reqPageNum					页码，StarRtc.Instance.getOnlineNumber调用后，会在回调中返回总数量和总页数</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.getAllUserList = function (reqPageNum) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 创建超级对讲房间</span><br><span class="line"> * @param _oper							操作类型：<span class="keyword">new</span>，创建；open，加入</span><br><span class="line"> * @param _userCallback					消息回调</span><br><span class="line"> * @param _userData						存储超级对讲房间的相关信息（id，name，creator），结构为&#123;<span class="string">"roomInfo"</span>:&#123;<span class="string">"id"</span>:<span class="string">""</span>,  <span class="string">"name"</span>:<span class="string">""</span>, <span class="string">"creator"</span>:<span class="string">""</span>&#125;&#125;</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.getSuperRoomSDK = function (_oper, _userCallback, _userData)</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 保存房间信息（非AEC下使用此接口做演示）</span><br><span class="line"> * @param listType						保存类型，见CHATROOM_LIST_TYPE</span><br><span class="line"> * @param roomInfo						结构为&#123;<span class="string">"id"</span>:<span class="string">""</span>, <span class="string">"name"</span>:<span class="string">""</span>, <span class="string">"creator"</span>:<span class="string">""</span>&#125;</span><br><span class="line"> * @param callback						回调函数</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.reportRoom = function (listType, roomInfo, callback) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 删除房间信息（非AEC下使用此接口做演示）</span><br><span class="line"> * @param listType						保存类型，见CHATROOM_LIST_TYPE</span><br><span class="line"> * @param roomInfo						结构为&#123;<span class="string">"id"</span>:<span class="string">""</span>, <span class="string">"name"</span>:<span class="string">""</span>, <span class="string">"creator"</span>:<span class="string">""</span>&#125;</span><br><span class="line"> * @param callback						回调函数</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSDK.delRoom = function (listType, roomInfo, callback)</span></span><br></pre></td></tr></table></figure>
<hr>
<h2 id="7-StarRtc-StarRoomSDK" class="article-heading"><a href="#7-StarRtc-StarRoomSDK" class="headerlink" title="7. StarRtc.StarRoomSDK"></a>7. StarRtc.StarRoomSDK<a class="article-anchor" href="#7-StarRtc-StarRoomSDK" aria-hidden="true"></a></h2><figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 构造函数</span></span><br><span class="line"><span class="comment"> * @param _type						类型：vdn，观看者；src，上传者</span></span><br><span class="line"><span class="comment"> * @param _oper						操作类型：new，创建；open，加入</span></span><br><span class="line"><span class="comment"> * @param _userCallback				消息回调</span></span><br><span class="line"><span class="comment"> * @param _userData					存储聊天室的相关信息（id，name，creator），结构为&#123;"roomInfo":&#123;"id":"", "name":"", "creator":""&#125;&#125;</span></span><br><span class="line"><span class="comment"> * @param _config					房间配置，可不传入</span></span><br><span class="line"><span class="comment"> * @param _liveType					房间类型，见CHATROOM_LIST_TYPE</span></span><br><span class="line"><span class="comment"> * @param _starImInterface			设置回调，用于接管login方法中设置的登录回调中的onVoipMessage部分</span></span><br><span class="line"><span class="comment"> * @param _starUser					用户信息（见StarRtc.StarUserInfo）</span></span><br><span class="line"><span class="comment"> * @param _starConfig				star配置（见StarRtc.StarConfig）</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line">StarRtc.StarRoomSDK = <span class="function"><span class="keyword">function</span> (<span class="params">_type, _oper, _userCallback, _userData, _config, _liveType, _starImInterface, _starUser, _starConfig</span>)</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 连接房间</span></span><br><span class="line"><span class="function"> */	</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarRoomSDK</span>.<span class="title">sigConnect</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 断连房间</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">flag</span>	是否主动断开连接的标志为，用于判断重连</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarRoomSDK</span>.<span class="title">sigDisconnect</span> = <span class="title">function</span> (<span class="params">_flag</span>)</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 创建房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarRoomSDK</span>.<span class="title">createNew</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 删除房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarRoomSDK</span>.<span class="title">deleteCurrRoom</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 创建本地视频流</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">streamOption</span> 	流配置（分辨率等），如</span>&#123; <span class="string">"video"</span>: <span class="literal">true</span>, <span class="string">"audio"</span>: &#123; <span class="attr">deviceId</span>: &#123; <span class="attr">ideal</span>: [<span class="string">"default"</span>] &#125; &#125; &#125;， 或&#123; <span class="string">"video"</span>: &#123; <span class="attr">width</span>: &#123; <span class="attr">ideal</span>: <span class="number">640</span> &#125;, <span class="attr">height</span>: &#123; <span class="attr">ideal</span>: <span class="number">480</span> &#125;, <span class="attr">frameRate</span>: &#123; <span class="attr">ideal</span>: <span class="number">25</span> &#125;, <span class="attr">facingMode</span>: &#123; <span class="attr">ideal</span>: [<span class="string">"user"</span>] &#125; &#125;, <span class="string">"audio"</span>: &#123; <span class="attr">deviceId</span>: &#123; <span class="attr">ideal</span>: [<span class="string">"default"</span>] &#125; &#125;</span><br><span class="line">			&#125;</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.createStream = function (streamOption) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 创建分享屏幕视频流</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.createScreenCaptureStream = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> *  设置流可见性（会同时影响自己本地流和对端流）</span><br><span class="line"> * 	@param config 流可见性配置&#123;<span class="string">"video"</span>:<span class="literal">true</span>, <span class="string">"audio"</span>:<span class="literal">true</span>&#125;</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.publishStream = function (config)</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 加入房间</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.joinRoom = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 离开房间</span><br><span class="line"> * @param _flag		是否主动离开（可选）</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.leaveRoom = function (_flag) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 切换大小图</span><br><span class="line"> * @param streamConfig	切换大小图的配置，数组，<span class="number">1</span>为小图，<span class="number">2</span>为大图[<span class="number">1</span>,<span class="number">2</span>,<span class="number">1</span>,<span class="number">2.</span>..]</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.streamConfigApply = function (streamConfig) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送聊天室消息</span><br><span class="line"> * @param msg	消息</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.sendChatMsg = function (msg)</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送voip消息（IM单聊消息）</span><br><span class="line"> * @param msg	消息</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.sendVoipMsg = function (msg) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送聊天室私聊消息</span><br><span class="line"> * @param toUserId	发送对象</span><br><span class="line"> * @param msg		消息</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.sendChatPrivateMsg = function (userId, msg) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送申请上麦消息</span><br><span class="line"> *<span class="regexp">/		</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.sendApplyMsg = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送同意申请上麦消息</span><br><span class="line"> * @param userId 	待发送的用户id</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.sendApplyAgreeMsg = function (userId)</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送拒绝申请上麦消息</span><br><span class="line"> * @param userId 	待发送的用户id</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.sendApplyDisagreeMsg = function (userId) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送邀请上麦消息</span><br><span class="line"> * @param userId 	待发送的用户id</span><br><span class="line"> *<span class="regexp">/	</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.sendInviteLinkMsg = function (userId) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送同意邀请上麦消息</span><br><span class="line"> *<span class="regexp">/	</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.sendInviteLinkAgreeMsg = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送拒绝邀请上麦消息</span><br><span class="line"> *<span class="regexp">/	</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.sendInviteLinkDisagreeMsg = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送开始邀请上麦消息</span><br><span class="line"> *<span class="regexp">/	</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.sendInviteLinkStartMsg = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送断开上麦消息</span><br><span class="line"> * @param userId 	待发送的用户id</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.sendLinkStopMsg = function (userId) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 聊天室踢人</span><br><span class="line"> * @param kickOutUserId	踢出的用户Id</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.kickOutUser = function (kickOutUserId)</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 聊天室禁言</span><br><span class="line"> * @param banUserId	禁言的用户Id</span><br><span class="line"> * @param banTime	禁言的时间长度</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.banToSendMsg = function (banUserId, banTime)</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 获取聊天室在线用户数</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.getRoomOnlineNum = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送实时数据</span><br><span class="line"> * @param data	实时数据</span><br><span class="line"> *<span class="regexp">/	</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.sendStreamData = function (data) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 获取是主动断开还是被动断开</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarRoomSDK.activeDisconnect = function ()</span></span><br></pre></td></tr></table></figure>
<hr>
<h2 id="8-StarRtc-StarSuperRoomSDK" class="article-heading"><a href="#8-StarRtc-StarSuperRoomSDK" class="headerlink" title="8. StarRtc.StarSuperRoomSDK"></a>8. StarRtc.StarSuperRoomSDK<a class="article-anchor" href="#8-StarRtc-StarSuperRoomSDK" aria-hidden="true"></a></h2><figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 构造函数</span></span><br><span class="line"><span class="comment"> * @param _oper						操作类型：new，创建；open，加入</span></span><br><span class="line"><span class="comment"> * @param _userCallback				消息回调</span></span><br><span class="line"><span class="comment"> * @param _userData					存储聊天室的相关信息（id，name，creator），结构为&#123;"roomInfo":&#123;"id":"", "name":"", "creator":""&#125;&#125;</span></span><br><span class="line"><span class="comment"> * @param _starUser					用户信息（见StarRtc.StarUserInfo）</span></span><br><span class="line"><span class="comment"> * @param _starConfig				star配置（见StarRtc.StarConfig）</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line">StarRtc.StarSuperRoomSDK = <span class="function"><span class="keyword">function</span> (<span class="params">_oper, _userCallback, _userData, _starUser, _starConfig</span>)</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 连接房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSuperRoomSDK</span>.<span class="title">sigConnect</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 断连房间</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">flag</span>	是否主动断开连接的标志为，用于判断重连</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSuperRoomSDK</span>.<span class="title">sigDisconnect</span> = <span class="title">function</span> (<span class="params">_flag</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 创建房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSuperRoomSDK</span>.<span class="title">createNew</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 删除房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarSuperRoomSDK</span>.<span class="title">deleteCurrRoom</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 创建本地视频流</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">streamOption</span> 	流配置（分辨率等），如</span>&#123; <span class="string">"video"</span>: <span class="literal">true</span>, <span class="string">"audio"</span>: &#123; <span class="attr">deviceId</span>: &#123; <span class="attr">ideal</span>: [<span class="string">"default"</span>] &#125; &#125; &#125;， 或&#123; <span class="string">"video"</span>: &#123; <span class="attr">width</span>: &#123; <span class="attr">ideal</span>: <span class="number">640</span> &#125;, <span class="attr">height</span>: &#123; <span class="attr">ideal</span>: <span class="number">480</span> &#125;, <span class="attr">frameRate</span>: &#123; <span class="attr">ideal</span>: <span class="number">25</span> &#125;, <span class="attr">facingMode</span>: &#123; <span class="attr">ideal</span>: [<span class="string">"user"</span>] &#125; &#125;, <span class="string">"audio"</span>: &#123; <span class="attr">deviceId</span>: &#123; <span class="attr">ideal</span>: [<span class="string">"default"</span>] &#125; &#125;</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSuperRoomSDK.createStream = function (streamOption) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 加入房间</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSuperRoomSDK.joinRoom = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 离开房间</span><br><span class="line"> * @param _flag		是否主动离开（可选）</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSuperRoomSDK.leaveRoom = function (_flag) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送聊天室消息</span><br><span class="line"> * @param msg	消息</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSuperRoomSDK.sendChatMsg = function (msg) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送聊天室私聊消息</span><br><span class="line"> * @param toUserId	发送对象</span><br><span class="line"> * @param msg		消息</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSuperRoomSDK.sendChatPrivateMsg = function (userId, msg) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 聊天室踢人</span><br><span class="line"> * @param kickOutUserId	踢出的用户Id</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSuperRoomSDK.kickOutUser = function (kickOutUserId) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 聊天室禁言</span><br><span class="line"> * @param banUserId	禁言的用户Id</span><br><span class="line"> * @param banTime	禁言的时间长度</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSuperRoomSDK.banToSendMsg = function (banUserId, banTime) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 获取聊天室在线用户数</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSuperRoomSDK.getRoomOnlineNum = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 获取是主动断开还是被动断开</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSuperRoomSDK.activeDisconnect = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 开始对讲</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSuperRoomSDK.startTalk = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 结束对讲</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarSuperRoomSDK.endTalk = function ()</span></span><br></pre></td></tr></table></figure>
<hr>
<h2 id="9-StarRtc-StarChatRoomSDK" class="article-heading"><a href="#9-StarRtc-StarChatRoomSDK" class="headerlink" title="9. StarRtc.StarChatRoomSDK"></a>9. StarRtc.StarChatRoomSDK<a class="article-anchor" href="#9-StarRtc-StarChatRoomSDK" aria-hidden="true"></a></h2><figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 构造函数</span></span><br><span class="line"><span class="comment"> * @param _oper						操作类型：new，创建；open，加入</span></span><br><span class="line"><span class="comment"> * @param _userCallback				消息回调</span></span><br><span class="line"><span class="comment"> * @param _userData					存储聊天室的相关信息（id，name，creator），结构为&#123;"roomInfo":&#123;"id":"", "name":"", "creator":""&#125;&#125;</span></span><br><span class="line"><span class="comment"> * @param _liveType					房间类型，见CHATROOM_LIST_TYPE</span></span><br><span class="line"><span class="comment"> * @param _starUser					用户信息（见StarRtc.StarUserInfo）</span></span><br><span class="line"><span class="comment"> * @param _starConfig				star配置（见StarRtc.StarConfig）</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line">StarRtc.StarChatRoomSDK = <span class="function"><span class="keyword">function</span> (<span class="params">_oper, _userCallback, _userData, _liveType, _starUser, _starConfig</span>)</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 连接房间</span></span><br><span class="line"><span class="function"> */	</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatRoomSDK</span>.<span class="title">sigConnect</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 断连房间</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">flag</span>	是否主动断开连接的标志为，用于判断重连</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatRoomSDK</span>.<span class="title">sigDisconnect</span> = <span class="title">function</span> (<span class="params">_flag</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 创建房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatRoomSDK</span>.<span class="title">createNew</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 发送聊天室消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">msg</span>	消息</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatRoomSDK</span>.<span class="title">sendChatMsg</span> = <span class="title">function</span> (<span class="params">msg</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 发送聊天室私聊消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">toUserId</span>	发送对象</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">msg</span>		消息</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatRoomSDK</span>.<span class="title">sendChatPrivateMsg</span> = <span class="title">function</span> (<span class="params">toUserId, msg</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 发送聊天室私聊控制消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">toUserId</span>	发送对象</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">msg</span>		消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">code</span>		控制码</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatRoomSDK</span>.<span class="title">sendChatCtrlPrivateMsg</span> = <span class="title">function</span> (<span class="params">toUserId, msg, code</span>)</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 聊天室踢人</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">kickOutUserId</span>	踢出的用户<span class="title">Id</span></span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatRoomSDK</span>.<span class="title">kickOutUser</span> = <span class="title">function</span> (<span class="params">kickOutUserId</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 聊天室禁言</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">banUserId</span>	禁言的用户<span class="title">Id</span></span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">banTime</span>	禁言的时间长度</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatRoomSDK</span>.<span class="title">banToSendMsg</span> = <span class="title">function</span> (<span class="params">banUserId, banTime</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 获取聊天室在线用户数</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatRoomSDK</span>.<span class="title">getRoomOnlineNum</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 删除房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatRoomSDK</span>.<span class="title">deleteCurrRoom</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 加入房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatRoomSDK</span>.<span class="title">joinRoom</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 离开房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatRoomSDK</span>.<span class="title">leaveRoom</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 获取是主动断开还是被动断开</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatRoomSDK</span>.<span class="title">activeDisconnect</span> = <span class="title">function</span> (<span class="params"></span>)</span></span><br></pre></td></tr></table></figure>
<hr>
<h2 id="10-StarRtc-StarVideoRoomSDK" class="article-heading"><a href="#10-StarRtc-StarVideoRoomSDK" class="headerlink" title="10. StarRtc.StarVideoRoomSDK"></a>10. StarRtc.StarVideoRoomSDK<a class="article-anchor" href="#10-StarRtc-StarVideoRoomSDK" aria-hidden="true"></a></h2><figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 构造函数</span></span><br><span class="line"><span class="comment"> * @param _type						类型：vdn，观看者；src，上传者</span></span><br><span class="line"><span class="comment"> * @param _oper						操作类型：new，创建；open，加入</span></span><br><span class="line"><span class="comment"> * @param _userCallback				消息回调</span></span><br><span class="line"><span class="comment"> * @param _userData					存储聊天室的相关信息（id，name，creator），结构为&#123;"roomInfo":&#123;"id":"", "name":"", "creator":""&#125;&#125;</span></span><br><span class="line"><span class="comment"> * @param _liveType					房间类型，见CHATROOM_LIST_TYPE</span></span><br><span class="line"><span class="comment"> * @param _starUser					用户信息（见StarRtc.StarUserInfo）</span></span><br><span class="line"><span class="comment"> * @param _starConfig				star配置（见StarRtc.StarConfig）</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line">StarRtc.StarVideoRoomSDK = <span class="function"><span class="keyword">function</span> (<span class="params">_type, _oper, _userCallback, _userData, _liveType, _starUser, _starConfig</span>)</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 连接房间</span></span><br><span class="line"><span class="function"> */		</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarVideoRoomSDK</span>.<span class="title">sigConnect</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 断连房间</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">flag</span>	是否主动断开连接的标志为，用于判断重连</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarVideoRoomSDK</span>.<span class="title">sigDisconnect</span> = <span class="title">function</span> (<span class="params">_flag</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 创建房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarVideoRoomSDK</span>.<span class="title">createNew</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 创建超级对讲房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarVideoRoomSDK</span>.<span class="title">createNewSuperRoom</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 删除房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarVideoRoomSDK</span>.<span class="title">deleteCurrRoom</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 创建本地视频流</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">streamOption</span> 	流配置（分辨率等），如</span>&#123; <span class="string">"video"</span>: <span class="literal">true</span>, <span class="string">"audio"</span>: &#123; <span class="attr">deviceId</span>: &#123; <span class="attr">ideal</span>: [<span class="string">"default"</span>] &#125; &#125; &#125;， 或&#123; <span class="string">"video"</span>: &#123; <span class="attr">width</span>: &#123; <span class="attr">ideal</span>: <span class="number">640</span> &#125;, <span class="attr">height</span>: &#123; <span class="attr">ideal</span>: <span class="number">480</span> &#125;, <span class="attr">frameRate</span>: &#123; <span class="attr">ideal</span>: <span class="number">25</span> &#125;, <span class="attr">facingMode</span>: &#123; <span class="attr">ideal</span>: [<span class="string">"user"</span>] &#125; &#125;, <span class="string">"audio"</span>: &#123; <span class="attr">deviceId</span>: &#123; <span class="attr">ideal</span>: [<span class="string">"default"</span>] &#125; &#125;</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoRoomSDK.createStream = function (streamOption) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 创建分享屏幕视频流</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoRoomSDK.createScreenCaptureStream = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> *  设置流可见性（会同时影响自己本地流和对端流）</span><br><span class="line"> * 	@param config 流可见性配置&#123;<span class="string">"video"</span>:<span class="literal">true</span>, <span class="string">"audio"</span>:<span class="literal">true</span>&#125;</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoRoomSDK.publishStream = function (config)</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 加入房间</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoRoomSDK.joinRoom = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 离开房间</span><br><span class="line"> * @param _flag		是否主动离开（可选）</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoRoomSDK.leaveRoom = function (flag) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 切换大小图</span><br><span class="line"> * @param streamConfig	切换大小图的配置，数组，<span class="number">1</span>为小图，<span class="number">2</span>为大图[<span class="number">1</span>,<span class="number">2</span>,<span class="number">1</span>,<span class="number">2.</span>..]</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoRoomSDK.streamConfigApply = function (streamConfig) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送实时数据</span><br><span class="line"> * @param data	实时数据</span><br><span class="line"> *<span class="regexp">/	</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoRoomSDK.sendStreamData = function (data) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 获取是主动断开还是被动断开</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoRoomSDK.activeDisconnect = function ()</span></span><br></pre></td></tr></table></figure>
<hr>
<h2 id="11-StarRtc-StarVideoSDK" class="article-heading"><a href="#11-StarRtc-StarVideoSDK" class="headerlink" title="11. StarRtc.StarVideoSDK"></a>11. StarRtc.StarVideoSDK<a class="article-anchor" href="#11-StarRtc-StarVideoSDK" aria-hidden="true"></a></h2><figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 构造函数</span></span><br><span class="line"><span class="comment"> * @param _type						类型：vdn，观看者；src，上传者</span></span><br><span class="line"><span class="comment"> * @param _oper						操作类型：new，创建；open，加入</span></span><br><span class="line"><span class="comment"> * @param _userCallback				消息回调</span></span><br><span class="line"><span class="comment"> * @param _userData					存储聊天室的相关信息（id，name，creator），结构为&#123;"roomInfo":&#123;"id":"", "name":"", "creator":""&#125;&#125;</span></span><br><span class="line"><span class="comment"> * @param _liveType					房间类型，见CHATROOM_LIST_TYPE</span></span><br><span class="line"><span class="comment"> * @param _starUser					用户信息（见StarRtc.StarUserInfo）</span></span><br><span class="line"><span class="comment"> * @param _starConfig				star配置（见StarRtc.StarConfig）</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line">StarRtc.StarVideoSDK = <span class="function"><span class="keyword">function</span> (<span class="params">_type, _oper, _userCallback, _userData, _liveType, _starUser, _starConfig</span>)</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 连接房间</span></span><br><span class="line"><span class="function"> */		</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarVideoSDK</span>.<span class="title">sigConnect</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 断连房间</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">flag</span>	是否主动断开连接的标志为，用于判断重连</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarVideoSDK</span>.<span class="title">sigDisconnect</span> = <span class="title">function</span> (<span class="params">_flag</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 创建房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarVideoSDK</span>.<span class="title">createNew</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 创建超级对讲房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarVideoSDK</span>.<span class="title">createNewSuperRoom</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 删除房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarVideoSDK</span>.<span class="title">deleteCurrRoom</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 创建本地视频流</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">streamOption</span> 	流配置（分辨率等），如</span>&#123; <span class="string">"video"</span>: <span class="literal">true</span>, <span class="string">"audio"</span>: &#123; <span class="attr">deviceId</span>: &#123; <span class="attr">ideal</span>: [<span class="string">"default"</span>] &#125; &#125; &#125;， 或&#123; <span class="string">"video"</span>: &#123; <span class="attr">width</span>: &#123; <span class="attr">ideal</span>: <span class="number">640</span> &#125;, <span class="attr">height</span>: &#123; <span class="attr">ideal</span>: <span class="number">480</span> &#125;, <span class="attr">frameRate</span>: &#123; <span class="attr">ideal</span>: <span class="number">25</span> &#125;, <span class="attr">facingMode</span>: &#123; <span class="attr">ideal</span>: [<span class="string">"user"</span>] &#125; &#125;, <span class="string">"audio"</span>: &#123; <span class="attr">deviceId</span>: &#123; <span class="attr">ideal</span>: [<span class="string">"default"</span>] &#125; &#125;</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoSDK.createStream = function (streamOption) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 创建分享屏幕视频流</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoSDK.createScreenCaptureStream = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> *  设置流可见性（会同时影响自己本地流和对端流）</span><br><span class="line"> * 	@param config 流可见性配置&#123;<span class="string">"video"</span>:<span class="literal">true</span>, <span class="string">"audio"</span>:<span class="literal">true</span>&#125;</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoSDK.publishStream = function (config)</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 加入房间</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoSDK.joinRoom = function () </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 离开房间</span><br><span class="line"> * @param _flag		是否主动离开（可选）</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoSDK.leaveRoom = function (flag) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 切换大小图</span><br><span class="line"> * @param streamConfig	切换大小图的配置，数组，<span class="number">1</span>为小图，<span class="number">2</span>为大图[<span class="number">1</span>,<span class="number">2</span>,<span class="number">1</span>,<span class="number">2.</span>..]</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoSDK.streamConfigApply = function (streamConfig) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 发送实时数据</span><br><span class="line"> * @param data	实时数据</span><br><span class="line"> *<span class="regexp">/	</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoSDK.sendStreamData = function (data) </span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">/</span>**</span><br><span class="line"> * 获取是主动断开还是被动断开</span><br><span class="line"> *<span class="regexp">/</span></span><br><span class="line"><span class="regexp">StarRtc.StarVideoSDK.activeDisconnect = function ()</span></span><br></pre></td></tr></table></figure>
<hr>
<h2 id="12-StarRtc-StarChatSDK" class="article-heading"><a href="#12-StarRtc-StarChatSDK" class="headerlink" title="12. StarRtc.StarChatSDK"></a>12. StarRtc.StarChatSDK<a class="article-anchor" href="#12-StarRtc-StarChatSDK" aria-hidden="true"></a></h2><figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 构造函数</span></span><br><span class="line"><span class="comment"> * @param _oper						操作类型：new，创建；open，加入</span></span><br><span class="line"><span class="comment"> * @param _userCallback				消息回调</span></span><br><span class="line"><span class="comment"> * @param _userData					存储聊天室的相关信息（id，name，creator），结构为&#123;"roomInfo":&#123;"id":"", "name":"", "creator":""&#125;&#125;</span></span><br><span class="line"><span class="comment"> * @param _liveType					房间类型，见CHATROOM_LIST_TYPE</span></span><br><span class="line"><span class="comment"> * @param _starUser					用户信息（见StarRtc.StarUserInfo）</span></span><br><span class="line"><span class="comment"> * @param _starConfig				star配置（见StarRtc.StarConfig）</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line">StarRtc.StarChatSDK = <span class="function"><span class="keyword">function</span> (<span class="params">_oper, _userCallback, _userData, _liveType, _starUser, _starConfig</span>)</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 连接房间</span></span><br><span class="line"><span class="function"> */	</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatSDK</span>.<span class="title">sigConnect</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 断连房间</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">flag</span>	是否主动断开连接的标志为，用于判断重连</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatSDK</span>.<span class="title">sigDisconnect</span> = <span class="title">function</span> (<span class="params">_flag</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 创建房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatSDK</span>.<span class="title">createNew</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 发送聊天室消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">msg</span>	消息</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatSDK</span>.<span class="title">sendChatMsg</span> = <span class="title">function</span> (<span class="params">msg</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 发送聊天室私聊消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">toUserId</span>	发送对象</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">msg</span>		消息</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatSDK</span>.<span class="title">sendChatPrivateMsg</span> = <span class="title">function</span> (<span class="params">toUserId, msg</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 发送聊天室私聊控制消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">toUserId</span>	发送对象</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">msg</span>		消息</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">code</span>		控制码</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatSDK</span>.<span class="title">sendChatCtrlPrivateMsg</span> = <span class="title">function</span> (<span class="params">toUserId, msg, code</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 聊天室踢人</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">kickOutUserId</span>	踢出的用户<span class="title">Id</span></span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatSDK</span>.<span class="title">kickOutUser</span> = <span class="title">function</span> (<span class="params">kickOutUserId</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 聊天室禁言</span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">banUserId</span>	禁言的用户<span class="title">Id</span></span></span><br><span class="line"><span class="function"> * @<span class="title">param</span> <span class="title">banTime</span>	禁言的时间长度</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatSDK</span>.<span class="title">banToSendMsg</span> = <span class="title">function</span> (<span class="params">banUserId, banTime</span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 获取聊天室在线用户数</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatSDK</span>.<span class="title">getRoomOnlineNum</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 删除房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatSDK</span>.<span class="title">deleteCurrRoom</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 加入房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatSDK</span>.<span class="title">joinRoom</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 离开房间</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatSDK</span>.<span class="title">leaveRoom</span> = <span class="title">function</span> (<span class="params"></span>) </span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">/**</span></span><br><span class="line"><span class="function"> * 获取是主动断开还是被动断开</span></span><br><span class="line"><span class="function"> */</span></span><br><span class="line"><span class="function"><span class="title">StarRtc</span>.<span class="title">StarChatSDK</span>.<span class="title">activeDisconnect</span> = <span class="title">function</span> (<span class="params"></span>)</span></span><br></pre></td></tr></table></figure>
<hr>

              </div>
              <footer class="article-footer">
                <time class="article-footer-updated" datetime="2020-09-06T00:27:31.380Z" itemprop="dateModified">上次更新<script type="text/javascript">document.write("："+(new Date()).toISOString().slice(0,10))</script></time>
		<a href="web-1.html" class="article-footer-prev" title="1.嵌入SDK"><i class="fa fa-chevron-left"></i><span>上一页</span></a><a href="web-4.html" class="article-footer-next" title="4.一对一消息"><span>下一页</span><i class="fa fa-chevron-right"></i></a>
              </footer>
            </div>
          </div>
          <aside id="article-toc" role="navigation">
            <div id="article-toc-inner">
              <strong class="sidebar-title">目录</strong>
              <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#SDK的说明和api介绍"><span class="toc-text">SDK的说明和api介绍</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-SDK对象简介"><span class="toc-text">1. SDK对象简介</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-LOG-LEVEL"><span class="toc-text">2. LOG_LEVEL</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-CHATROOM-LIST-TYPE"><span class="toc-text">3. CHATROOM_LIST_TYPE</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#4-StarRtc-StarConfig"><span class="toc-text">4. StarRtc.StarConfig</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#5-StarRtc-StarUserInfo"><span class="toc-text">5. StarRtc.StarUserInfo</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#6-StarRtc-StarSDK"><span class="toc-text">6. StarRtc.StarSDK</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#7-StarRtc-StarRoomSDK"><span class="toc-text">7. StarRtc.StarRoomSDK</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#8-StarRtc-StarSuperRoomSDK"><span class="toc-text">8. StarRtc.StarSuperRoomSDK</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#9-StarRtc-StarChatRoomSDK"><span class="toc-text">9. StarRtc.StarChatRoomSDK</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#10-StarRtc-StarVideoRoomSDK"><span class="toc-text">10. StarRtc.StarVideoRoomSDK</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#11-StarRtc-StarVideoSDK"><span class="toc-text">11. StarRtc.StarVideoSDK</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#12-StarRtc-StarChatSDK"><span class="toc-text">12. StarRtc.StarChatSDK</span></a></li></ol></li></ol>
              <a href="#" id="article-toc-top">回到顶部</a>
            </div>
          </aside>
        </div>
      </article>
      <aside id="sidebar" role="navigation">
  <div class="inner">
    <strong class="sidebar-title">开始使用</strong><a href="index.html" class="sidebar-link">概述</a><strong class="sidebar-title">Android集成</strong><a href="android-1.html" class="sidebar-link">1.嵌入SDK</a><a href="android-2.html" class="sidebar-link">2.SDK的基本说明</a><a href="android-3b.html" class="sidebar-link">3b.初始化(私有部署)</a><a href="android-4.html" class="sidebar-link">4.一对一消息</a><a href="android-5.html" class="sidebar-link">5.群组消息</a><a href="android-6.html" class="sidebar-link">6.聊天室消息</a><a href="android-7.html" class="sidebar-link">7.一对一视频通话</a><a href="android-8.html" class="sidebar-link">8.视频会议</a><a href="android-9.html" class="sidebar-link">9.互动直播</a><a href="android-10.html" class="sidebar-link">10.其它配套组件</a><a href="android-11.html" class="sidebar-link">11.超级对讲机</a><a href="android-user-list.html" class="sidebar-link">在线用户列表</a><a href="android-beauty-callback.html" class="sidebar-link">美颜接口</a><a href="android-errCode.html" class="sidebar-link">ErrorCode对照表</a><strong class="sidebar-title">iOS集成</strong><a href="ios-1.html" class="sidebar-link">1.嵌入SDK</a><a href="ios-2.html" class="sidebar-link">2.SDK的基本说明</a><a href="ios-3b.html" class="sidebar-link">3b.初始化(私有部署)</a><a href="ios-4.html" class="sidebar-link">4.一对一消息</a><a href="ios-5.html" class="sidebar-link">5.群组消息</a><a href="ios-6.html" class="sidebar-link">6.聊天室消息</a><a href="ios-7.html" class="sidebar-link">7.一对一视频通话</a><a href="ios-8.html" class="sidebar-link">8.视频会议</a><a href="ios-9.html" class="sidebar-link">9.互动直播</a><a href="ios-10.html" class="sidebar-link">10.内网P2P直连通话</a><strong class="sidebar-title">web端集成</strong><a href="web-1.html" class="sidebar-link">1.嵌入SDK</a><a href="web-2.html" class="sidebar-link current">2.SDK的基本说明</a><a href="web-4.html" class="sidebar-link">4.一对一消息</a><a href="web-5.html" class="sidebar-link">5.群组消息</a><a href="web-6.html" class="sidebar-link">6.聊天室消息</a><a href="web-7.html" class="sidebar-link">7.一对一视频通话</a><a href="web-8.html" class="sidebar-link">8.视频会议</a><a href="web-9.html" class="sidebar-link">9.互动直播</a><a href="web-10.html" class="sidebar-link">10.私有部署</a><strong class="sidebar-title">Win PC端集成</strong><a href="win-1.html" class="sidebar-link">1.嵌入SDK</a><a href="win-2.html" class="sidebar-link">2.初始化</a><a href="win-3.html" class="sidebar-link">3.一对一消息</a><a href="win-4.html" class="sidebar-link">4.群组消息</a><a href="win-5.html" class="sidebar-link">5.聊天室消息</a><a href="win-6.html" class="sidebar-link">6.一对一视频通话</a><a href="win-7.html" class="sidebar-link">7.视频会议</a><a href="win-8.html" class="sidebar-link">8.互动直播</a><strong class="sidebar-title">服务端api开发</strong><a href="aec-index.html" class="sidebar-link">概述</a><a href="aec-group.html" class="sidebar-link">群事件通知</a><a href="aec-chatroom.html" class="sidebar-link">聊天室事件通知</a><a href="aec-voip.html" class="sidebar-link">单聊事件通知</a><a href="aec-channel.html" class="sidebar-link">音视频流事件通知</a><a href="aec-other.html" class="sidebar-link">其它事件通知</a>
  </div>
</aside>
    </div>
  </div>
</div>

    <footer id="footer" class="wrapper">
  <div class="inner">
    <div id="footer-copyright">
      &copy; 2010-2020 <a href="https://starrtc.gitee.io/" target="_blank">starRTC</a><br>
    </div>
    <div id="footer-links">
      <a href="https://gitee.com/starrtc" class="footer-link" target="_blank"><i class="fa fa-github-alt"></i></a>
    </div>
  </div>
</footer>

  </div>
  <div id="mobile-nav-dimmer"></div>
  <nav id="mobile-nav">
  <div id="mobile-nav-inner">
    <ul id="mobile-nav-list">
      <a href="https://starrtc.gitee.io/" class="main-nav-link">官网</a><a href="https://blog.starRTC.com" class="main-nav-link">博客</a><a href="https://github.com/starrtc/android-demo/issues" class="main-nav-link">论坛</a><a href="/zh-cn/docs/" class="mobile-nav-link">文档</a><a href="/zh-cn/download/" class="mobile-nav-link">下载</a><a href="/zh-cn/contact/" class="mobile-nav-link">联系我们</a>
      <li class="mobile-nav-item">
        <a href="https://github.com/starrtc" class="mobile-nav-link" rel="external" target="_blank">GitHub</a>
      </li>
    </ul>
    
      <strong class="mobile-nav-title">开始使用</strong><a href="index.html" class="mobile-nav-link">概述</a><strong class="mobile-nav-title">Android集成</strong><a href="android-1.html" class="mobile-nav-link">1.嵌入SDK</a><a href="android-2.html" class="mobile-nav-link">2.SDK的基本说明</a><a href="android-3b.html" class="mobile-nav-link">3b.初始化(私有部署)</a><a href="android-4.html" class="mobile-nav-link">4.一对一消息</a><a href="android-5.html" class="mobile-nav-link">5.群组消息</a><a href="android-6.html" class="mobile-nav-link">6.聊天室消息</a><a href="android-7.html" class="mobile-nav-link">7.一对一视频通话</a><a href="android-8.html" class="mobile-nav-link">8.视频会议</a><a href="android-9.html" class="mobile-nav-link">9.互动直播</a><a href="android-10.html" class="mobile-nav-link">10.其它配套组件</a><a href="android-11.html" class="mobile-nav-link">11.超级对讲机</a><a href="android-user-list.html" class="mobile-nav-link">在线用户列表</a><a href="android-beauty-callback.html" class="mobile-nav-link">美颜接口</a><a href="android-errCode.html" class="mobile-nav-link">ErrorCode对照表</a><strong class="mobile-nav-title">iOS集成</strong><a href="ios-1.html" class="mobile-nav-link">1.嵌入SDK</a><a href="ios-2.html" class="mobile-nav-link">2.SDK的基本说明</a><a href="ios-3b.html" class="mobile-nav-link">3b.初始化(私有部署)</a><a href="ios-4.html" class="mobile-nav-link">4.一对一消息</a><a href="ios-5.html" class="mobile-nav-link">5.群组消息</a><a href="ios-6.html" class="mobile-nav-link">6.聊天室消息</a><a href="ios-7.html" class="mobile-nav-link">7.一对一视频通话</a><a href="ios-8.html" class="mobile-nav-link">8.视频会议</a><a href="ios-9.html" class="mobile-nav-link">9.互动直播</a><a href="ios-10.html" class="mobile-nav-link">10.内网P2P直连通话</a><strong class="mobile-nav-title">web端集成</strong><a href="web-1.html" class="mobile-nav-link">1.嵌入SDK</a><a href="web-2.html" class="mobile-nav-link current">2.SDK的基本说明</a><a href="web-4.html" class="mobile-nav-link">4.一对一消息</a><a href="web-5.html" class="mobile-nav-link">5.群组消息</a><a href="web-6.html" class="mobile-nav-link">6.聊天室消息</a><a href="web-7.html" class="mobile-nav-link">7.一对一视频通话</a><a href="web-8.html" class="mobile-nav-link">8.视频会议</a><a href="web-9.html" class="mobile-nav-link">9.互动直播</a><a href="web-10.html" class="mobile-nav-link">10.私有部署</a><strong class="mobile-nav-title">Win PC端集成</strong><a href="win-1.html" class="mobile-nav-link">1.嵌入SDK</a><a href="win-2.html" class="mobile-nav-link">2.初始化</a><a href="win-3.html" class="mobile-nav-link">3.一对一消息</a><a href="win-4.html" class="mobile-nav-link">4.群组消息</a><a href="win-5.html" class="mobile-nav-link">5.聊天室消息</a><a href="win-6.html" class="mobile-nav-link">6.一对一视频通话</a><a href="win-7.html" class="mobile-nav-link">7.视频会议</a><a href="win-8.html" class="mobile-nav-link">8.互动直播</a><strong class="mobile-nav-title">服务端api开发</strong><a href="aec-index.html" class="mobile-nav-link">概述</a><a href="aec-group.html" class="mobile-nav-link">群事件通知</a><a href="aec-chatroom.html" class="mobile-nav-link">聊天室事件通知</a><a href="aec-voip.html" class="mobile-nav-link">单聊事件通知</a><a href="aec-channel.html" class="mobile-nav-link">音视频流事件通知</a><a href="aec-other.html" class="mobile-nav-link">其它事件通知</a>
    
  </div>
  <div id="mobile-lang-select-wrap">
    <span id="mobile-lang-select-label"><i class="fa fa-globe"></i><span>简体中文</span></span>
    <select id="mobile-lang-select" data-canonical="docs/web-2.html">
      
        <option value="en">English</option>
      
        <option value="zh-cn" selected>简体中文</option>
      
    </select>
  </div>
</nav>
  <!-- Scripts -->
<!-- build:js build/js/main.js -->
<script src="/js/lang_select.js"></script>
<script src="/js/toc.js"></script>
<script src="/js/mobile_nav.js"></script>
<!-- endbuild -->
<!-- Algolia -->

<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script>
<script type="text/javascript">
document.getElementById('search-input-wrap').classList.add('on');
docsearch({
  apiKey: 'cdea7d4e47d84f6145b77e7f68689f35',
  indexName: 'hexo_zh-cn',
  inputSelector: '#search-input'
});
</script>


</body>
</html>